Skip to content

Add user authentication and personal rankings#1

Open
NSC508 wants to merge 1 commit intomainfrom
add-user-auth-17959128693190551621
Open

Add user authentication and personal rankings#1
NSC508 wants to merge 1 commit intomainfrom
add-user-auth-17959128693190551621

Conversation

@NSC508
Copy link
Copy Markdown
Owner

@NSC508 NSC508 commented Mar 15, 2026

This PR implements a robust user authentication system, allowing multiple users to maintain their own personal multi-media rankings on a single hosted instance of Geli.

Key Changes:

  • Database: Added a new users table and linked all items to a specific user_id. Included an automatic migration script that safely transitions existing single-user data to a default_user (username: default_user, password: password).
  • Authentication Flow: Built full /login, /register, and /logout routes. Passwords are securely hashed using werkzeug.security.
  • Authorization: Added a @login_required decorator that protects personal ranking pages and returns appropriate 401 Unauthorized responses for API calls if a session expires.
  • UI: Added new sleek login and registration pages matching the dark glassmorphism theme, and updated the main navigation to display the current user and a logout button.
  • Documentation: Added a detailed step-by-step guide to the README.md for deploying the multi-user app for free on PythonAnywhere.

PR created automatically by Jules for task 17959128693190551621 started by @NSC508

Added a full user authentication system (login, registration, logout) to allow friends to maintain their own personal rankings on a hosted instance.

- Added `users` table to `models.py` and linked items to a `user_id` foreign key.
- Implemented robust database migration to gracefully handle existing data, assigning them to a "default_user" (password: "password") to prevent data loss.
- Created `login.html` and `register.html` templates and updated `base.html` navigation with a user dropdown.
- Scoped all ranking operations and database queries to the currently logged-in user's ID.
- Added a `login_required` decorator for protecting views and API endpoints.
- Updated the README with comprehensive instructions for free hosting on PythonAnywhere.

Co-authored-by: NSC508 <46616024+NSC508@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant